package com.djhu.freepartner.web.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.djhu.freepartner.bean.PartnerPost;
import com.djhu.freepartner.core.RestRsp;
import com.djhu.freepartner.core.exception.ServiceException;
import com.djhu.freepartner.web.control.model.PostSearchModel;
import com.djhu.freepartner.web.control.model.ReadPostRequest;

import java.util.List;

public interface PostService {
    /**
     * 检查发帖 是否用户当前是否能够 发帖 或者是否达到每日发帖量
     * @param userid 用户id
     * @return 检查结果
     */
    public RestRsp publishpostCheck(String userid);

    /**
     * 检查发帖 是否用户当前是否能够 阅读 或者是否达到每日发帖量
     * @param userid 用户id
     * @return 检查结果
     */
    public RestRsp readpostCheck(String userid,String postid);


    RestRsp pubishPost(PartnerPost partnerPost, boolean isFree) throws ServiceException;

    /**
     * 查询帖子
     * @param postSearchModel
     * @return
     */
    Page<PartnerPost> searchPost(PostSearchModel postSearchModel);

    PartnerPost readPost(ReadPostRequest readPostRequest) throws ServiceException;

    /**
     * 用户删除帖子
     * @param postSearchModel 只需要帖子ID 就可以
     * @return
     */
    boolean deletePost(PostSearchModel postSearchModel);

    List<PartnerPost> list(String userid);
}
